﻿//双击事件
function CustomDbClick() {
    parent.closeWin(); //去掉双击功能

}

//添加信息
var fnCustomAdd = function () {

}

//修改
var fnCustomEdit = function () {
    
}

//删除
var fnCustomDelete = function () {

}

//保存技能要求
var fnSaveSkill = function () {
    //debugger
    //保存列表
    var postID = getPar1("postID");
    var postName = getPar1("postName");
    var action = getPar1("action");
    var strEntity = getPar1("strEntity");
    var EmpID = getPar1("EmpID");
    //alert("postID:" + postID + " EmpID:" + EmpID + " postName:" + postName + " action:" + action + " strEntity:" + strEntity);
    var list = this.mDataTable.getRecordSet()._records;
    var elist = [];
    dl = [];
    for (var i = 0; i < list.length; i++) {
        //this.getRecordSet()._records[0]._oData["BarItem"]
        if (list[i]._oData["iSun_Selected"] == true) {
            elist.push(list[i]._oData);
        }
    }
    if (elist.length > 0) {
        var jsonStr = YAHOO.lang.JSON.stringify(elist);
        var SaveUrl = "AjaxData/DataSave.aspx?r=" + Math.random() + "&action=" + action + "&entity=" + strEntity + "&postID=" + postID + "&EmpID=" + EmpID + "&json=" + jsonStr;
        YAHOO.util.Connect.asyncRequest('POST', SaveUrl, {
            success: function (res) {
                try {
                    var str = res.responseText;
                    if (str == "1") {
                        alert("保存成功");
                        window.parent.$("#tabs").tabs('close', '');
                    }
                    else {
                        alert(str + "\n" + "保存失败!");
                    }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("保存失败，数据错误：" + error.statusText);
            }
        }, null);
    }
    else {
        alert("没有选择记录！")
        return;
    }
    window.parent.$("#tabs").tabs('close', '');
}

//初始化
if (typeof ($) != "undefined") {
    //debugger;
    $(document).ready(function () {

    });
}


